/*
 * TSimpleDelimiedParser.cpp
 *
 *  Created on: 2010-4-8
 *      Author: Administrator
 */

#include "TSimpleDelimiedParser.h"

TSimpleDelimiedParser::TSimpleDelimiedParser()
{
}
 
void TSimpleDelimiedParser::ParserWithDelimiter(const TDesC & aData,TChar aDelimiter)
{
	SetDelimiter(aDelimiter);
	Parse(aData) ;
}
 
void TSimpleDelimiedParser::ParserReverseWithDelimiter(const TDesC & aData,TChar aDelimiter)
{
	SetDelimiter(aDelimiter);
	ParseReverse(aData)	 ;
}
 
TPtrC TSimpleDelimiedParser::NextToken()
{
	TPtrC segment;
	if(!Eos()) 
	{
		GetNext(segment);
	}
	return segment;
}
 
TBool TSimpleDelimiedParser::IsEos()
	{
	return Eos();
	}
 
TPtrC TSimpleDelimiedParser::PreviousToken()
{
	TPtrC segment;
	if(!Eos())	
	{
		Dec();
		Peek(segment);
	}
	return segment;
}
